<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>CSC560 Design and Analysis of Real-Time Systems</title>
<meta name="keywords" content="CSC560" />
<meta name="description" content="CSC560" />
<link href="../default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
	<div id="header">
		<h1>CSC560</h1>
		<h2>Design and Analysis of Real-Time Systems</h2>
		<ul>
			<li class="first"> <a href="../index.html" accesskey="1" title="">Home</a> </li>
			<li> <a href="../project1/index.html" accesskey="2" title="">Project 1</a></li>
			<li> <a href="../project2/index.html" accesskey="3" title="">Project 2</a> </li>
			<li> <a href="../project3/index.html" accesskey="4" title="">Project 3</a> </li>
			<li> <a href="../project4/index.html" accesskey="5" title="">Project 4</a> </li>
			<li> <a href="index.html" accesskey="6" title="">Project 5</a> </li>
		</ul>
	</div>
</div>
<div id="content">
	<div id="colOne">
		<h2>Timing Diagram</h2>
		<p>
			Real time is not real fast. Too fast of processing is a waste of CPU cycles, while too slow of processing 
			results in irresponsive system. Therefore, timeliness, not the processing speed, ultimately determines the correctness of a real time system.

			In our current design, Cat is the most autonomous and most complex. Thus, we use the Timing Diagram 
			of Cat to illustrate the core timing requirement of our application. 			
		</p>
		<p>
			<h3>Cat</h3>
			There are five tasks scheduled in Cat: Sensor, Searching, Chasing, Radio Rx, & Radio Tx
			<br><br>
			<h4>Sensor task</h4>
			Sensor task polls IR beacon status to determine whether the Mouse is detected and in which of the four 
			directions. The direction is determined by which beacon pin value is pulled low. 
			It fires the Cat-Detected event when a sensor pin is activated. It’s similar to 
			polling joystick positions as in Project 2. Sensor task must execute frequently enough so that it 
			does not miss the activation of an IR sensor pin. Sensor task must not execute too frequently neither 
			that it consumes most of the CPU cycles.		
			<br><br>
			<h4>Searching task</h4>
			Searching task moves randomly to seek for Mouse without timing concern. It’s therefore best suited as a 
			background Round Robin task that executes whenever no other tasks of higher priority are executing. 			<br><br>
			<h4>Chasing task</h4>
			Chasing chases Mouse by moving in the direction of Mouse until the Mouse is no longer detected or caught. 
			It must be executed quickly whenever Mouse is detected (Mouse-Detected event) and for as long as Mouse is insight. Therefore, we 
			assign it as a system task. 
			<br><br>
			<h4>Radio Rx task</h4>
			Rx receives radio packets and must execute timely whenever a radio packet has arrived (an event). Thus, we 
			decide it should a system task.
			<br><br>
			<h4>Radio Tx task</h4>
			Tx transmits radio packets and must execute timely whenever there is a radio packet to be sent (an event). Thus, we 
			decide it should a system task.
			<br><br>
		</p>
		<p>
			<h3>Timing Diagram: Cat</h3>
			<img src="images/timing_diagram.jpg" alt="Timing Diagram: Cat" width="100%"/>	
			<br><br>					
		</p>
		<p>
			<h3>Mouse</h3>
			Mouse essentially has the opposite behaviour as the Cat. It attemps to run away from the Cat whenever it detects the Cat in sight.
			Mouse therefore has the following tasks:
			<br><br>
			<h4>Sensor task</h4>
			Sensor task polls IR beacon status to determine whether the Cat is detected and in which of the four directions.		
			It fires the Cat-Detected event when a sensor pin is activated.
			<br><br>
			<h4>Searching task</h4>
			Searching task moves randomly without timing concern. It’s therefore best suited as a 
			background Round Robin task that executes whenever no other tasks of higher priority are executing. 			
			<br><br>
			<h4>Escaping task</h4>
			Escaping drives Mouse away from Cat by moving in the opposite direction of Cat until the Cat is no longer detected or game over. 
			It must be executed quickly whenever Cat is detected (Cat-Detected event) and for as long as Cat is insight. Therefore, we 
			assign it as a system task. 
			<br><br>
			<h4>Radio Rx task</h4>
			Rx receives radio packets and must execute timely whenever a radio packet has arrived (an event). Thus, we 
			decide it should a system task.
			<br><br>
			<h4>Radio Tx task</h4>
			Tx transmits radio packets and must execute timely whenever there is a radio packet to be sent (an event). Thus, we 
			decide it should a system task.
			<br><br>
		</p>
	</div>
	<div id="colTwo">
		<h3>Project Sections</h3>
		<ul>
			<li class="first"><a href="01_hardware_description.html">Hardware Description</a></li>
			<li><a href="02_software_design.html"><b>Software Design</b></a></li>
			<li><a href="03_implementation_approach.html">Implementation Approach</a></li>
			<li><a href="04_development_process.html">Development Process</a></li>
			<li><a href="05_doxygen.html">Doxygen</a></li>
			<li><a href="http://code.google.com/p/wireless-roomba">Google Code</a></li>
			<li><a href="07_future_work.html">Future Work</a></li>
		</ul>
	</div>
</div>
<div id="footer">
	<p>
		@ 2009. All Rights Reserved. Design by 
		<a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.
	</p>
</div>
</body>
</html>
